﻿/**
 * Copyright (C) 2011 original author and authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGuice.Inject.Spi
{
    //complete!
    /// <summary>
    /// 用于范围化一个注入的访问策略
    /// </summary>
    /// <typeparam name="V">访问方法返回的类型</typeparam>
    public interface IBindingScopingVisitor<V>
    {
        /// <summary>
        /// 访问一个单例。范围策略将在模块和注入器绑定中查找
        /// </summary>
        /// <returns></returns>
        V VisitEagerSingleton();

        /// <summary>
        /// 访问一个范围实例。范围策略在模块和注入器绑定中查找
        /// </summary>
        V VisitScope(IScope scope);

       /// <summary>
       /// 访问范围注释。范围策略仅仅在模块绑定中查找，实现此范围的实例油Binder.BindScope注册
       /// </summary>
       /// <param name="scopeAnnotation"></param>
       /// <returns></returns>
        V VisitScopeAnnotation(Type scopeAnnotation);

        /// <summary>
        /// 访问一个未指定的或未范围化得策略。在一个模块中，此策略指示注入器应该使用范围元特性查找范围。在一个注入器中，
        /// 他指示没有范围应用于绑定。一个未范围的绑定行为当他链接到一个范围绑定时行为与范围绑定类似
        /// </summary>
        /// <returns></returns>
        V VisitNoScoping();
    }
}
